package com.navinfo.tripanalysis.util;

import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.convert.NoOpDbRefResolver;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext;

/**
 *
 * @author machi
 * @create 2018/10/29
 **/
public class MongoConverter {

   private static MappingMongoConverter converter = new MappingMongoConverter(NoOpDbRefResolver.INSTANCE, new MongoMappingContext());

    private MongoConverter() {
    }

    public static MappingMongoConverter getConverter() {
        converter.setTypeMapper(new DefaultMongoTypeMapper(null));
        return converter;
    }
}
